package com.zitangkou.user.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zitangkou.user.domain.UserDomain;
import com.zitangkou.common.global.UserContent;
import com.zitangkou.user.info.UserInfo;
import com.zitangkou.user.req.user.*;
import com.zitangkou.user.resp.user.ConstantListResp;
import com.zitangkou.user.resp.user.UserLoginResp;

/**
 * 用户
 *
 * @author Deng Ningning
 * @version 1.0
 * @date 2020/8/31 16:39
 */
public interface IUserService {
    /**
     * 分页查询用户
     *
     * @param req
     * @param userContent
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.zitangkou.user.model.info.UserInfo>
     * @date 2021/2/27 13:11
     */
    IPage<UserInfo> getUserPage(GetUserByPageReq req, UserContent userContent);

    /**
     * 添加用户
     *
     * @param req
     * @return boolean
     * @author Deng Ningning
     * @date 2020/9/2 11:56
     */
    boolean insertUser(AddUserReq req);

    /**
     * 修改用户
     *
     * @param req
     * @return boolean
     * @author Deng Ningning
     * @date 2020/9/2 11:56
     */
    boolean updateUser(EditUserReq req);

    /**
     * 删除用户
     *
     * @param userId
     * @return boolean
     * @author Deng Ningning
     * @date 2020/9/2 11:56
     */
    boolean deleteUser(String userId);

    /**
     * 用户账号登录
     *
     * @param req
     * @param userContent
     * @return com.zitangkou.user.model.resp.user.UserLoginResp
     * @author Deng Ningning
     * @date 2020/12/26 14:20
     */
    UserLoginResp accountLogin(AccountLoginReq req, UserContent userContent);

    /**
     * 用户手机号码注册
     *
     * @param req
     * @param userContent
     * @return com.zitangkou.user.model.resp.user.UserLoginResp
     * @author Deng Ningning
     * @date 2020/9/3 10:35
     */
    boolean mobileRegister(MobileRegisterReq req, UserContent userContent);

    /**
     * 发送短信验证码
     *
     * @param req
     * @param userContent
     * @return boolean
     * @author Deng Ningning
     * @date 2020/9/3 11:39
     */
    boolean sendMobileCode(SendMobileCodeReq req, UserContent userContent);

    /**
     * 根据账号查询用户
     *
     * @param enterpriseId
     * @param name
     * @return com.zitangkou.user.model.entity.UserDo
     * @date 2021/2/27 13:31
     */
    UserDomain selectByUserAccount(String enterpriseId, String name);

    /**
     * 发送邮箱验证码
     *
     * @param req
     * @param userContent
     * @return boolean
     * @author Deng Ningning
     * @date 2020/9/11 21:54
     */
    boolean sendEmailCode(SendEmailCodeReq req, UserContent userContent);

    /**
     * 用户邮箱号码注册
     *
     * @param req
     * @param userContent
     * @return boolean
     * @author Deng Ningning
     * @date 2020/9/11 22:18
     */
    boolean emailRegister(EmailRegisterReq req, UserContent userContent);

    /**
     * 手机号码登录
     *
     * @param req
     * @param userContent
     * @return com.zitangkou.user.model.resp.user.UserLoginResp
     * @author Deng Ningning
     * @date 2020/9/11 22:46
     */
    UserLoginResp mobileLogin(MobileLoginReq req, UserContent userContent);

    /**
     * 邮箱登录
     *
     * @param req
     * @param userContent
     * @return com.zitangkou.user.model.resp.user.UserLoginResp
     * @author Deng Ningning
     * @date 2020/9/13 13:44
     */
    UserLoginResp emailLogin(EmailLoginReq req, UserContent userContent);

    /**
     * 绑定手机号码
     *
     * @param req
     * @param userContent
     * @return boolean
     * @author Deng Ningning
     * @date 2020/9/16 22:54
     */
    boolean bindMobile(MobileLoginReq req, UserContent userContent);

    /**
     * 绑定邮箱
     *
     * @param req
     * @param userContent
     * @return boolean
     * @author Deng Ningning
     * @date 2020/9/16 23:31
     */
    boolean bindEmail(EmailLoginReq req, UserContent userContent);

    /**
     * 判断账号是否存在
     *
     * @param req
     * @param userContent
     * @return boolean
     * @author Deng Ningning
     * @date 2020/9/17 16:57
     */
    boolean accountExist(AccountExistReq req, UserContent userContent);

    /**
     * 判断手机号码是否存在
     *
     * @param req
     * @param userContent
     * @return boolean
     * @author Deng Ningning
     * @date 2020/9/17 16:57
     */
    boolean mobileExist(MobileExistReq req, UserContent userContent);

    /**
     * 判断手邮箱是否存在
     *
     * @param req
     * @param userContent
     * @return boolean
     * @author Deng Ningning
     * @date 2020/9/17 16:57
     */
    boolean emailExist(EmailExistReq req, UserContent userContent);

    /**
     * 查询常量
     *
     * @param type
     * @return com.zitangkou.user.model.resp.user.ConstantListResp
     * @author Deng Ningning
     * @date 2020/9/29 20:25
     */
    ConstantListResp getConstants(String type);

    /**
     * 查询当前用户
     *
     * @param userContent
     * @return com.zitangkou.user.model.resp.user.UserLoginResp
     * @author Deng Ningning
     * @date 2020/10/28 22:25
     */
    UserLoginResp getUserInfo(UserContent userContent);

    /**
     * 退出登录
     *
     * @param userContent
     * @return boolean
     * @author Deng Ningning
     * @date 2020/10/30 13:51
     */
    boolean loginOut(UserContent userContent);

    /**
     * 修改用户密码
     *
     * @param req
     * @param userContent
     * @return boolean
     * @author Deng Ningning
     * @date 2020/12/6 12:19
     */
    boolean forgotPassword(ForgotPasswordReq req, UserContent userContent);

    /**
     * 根据查询用户
     *
     * @param userId
     * @return com.zitangkou.user.model.info.UserInfo
     * @date 2021/2/27 15:46
     */
    UserInfo getUserById(String userId);

    void consumeMsg(int i);

    void produceMsg(int msgNum);
}
